<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>  
<%@ page isELIgnored="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>GTD</title>
<jsp:include page="../../../../public/header.jsp"/>
</head>
<body>
	<jsp:include page="../../../../public/nav.jsp"/>
	<div>
		<div class="jumbotron" >
			<p style="text-align: center;">用户中心!</p>
		</div>
	</div>
	<!-- start左边菜单 -->
	<jsp:include page="../../../../public/usersLeft.jsp"></jsp:include>
	<!-- end左边菜单 -->
      <div class="col-xs-9">
      		<ol class="breadcrumb">
			  <li><a href="/users/index.html">用户中心</a></li>
			  <li><a href="#">我的工具</a></li>
			  <li class="active">GTD</li>
			</ol>
		<h2>${gtd.name }</h2>
		<div class="panel panel-info">
		  <div class="panel-heading">描述</div>
		  <div class="panel-body">
		    ${gtd.content }
		  </div>
		</div>
		<div class="panel panel-info">
		  <div class="panel-heading">时间</div>
		  <div class="panel-body">
		    开始:${gtd.startdate } - 结束:${gtd.enddate }
		  </div>
		</div>
		<div class="navbar-right">
			<c:if test="${gtd.doing == 'F' }">
				<a onclick="start(${gtd.id})"  class="btn-default" aria-label="Left Align"><span class="glyphicon glyphicon-play" aria-hidden="true">开始</span></a>
				<a class="btn-default" aria-label="Left Align"><span class="glyphicon glyphicon-play" aria-hidden="true">开始(短任务:设置定时)</span></a>
			</c:if>
			<c:if test="${gtd.doing == 'T' &&  data.done == 'F'}">
				<a  class="btn-default" aria-label="Left Align">正在进行</a>
			</c:if>
			<c:if test="${gtd.done == 'T'}">
				<a  class="btn-success" aria-label="Left Align">已经完成</a>
			</c:if>
			<a onclick="finish(${gtd.id})" class="btn-default" aria-label="Left Align"><span class="glyphicon glyphicon-stop" aria-hidden="true">完成</span></a>
			<a onclick="del(${gtd.id})"  class="btn-default" aria-label="Left Align"><span class="glyphicon glyphicon-remove" aria-hidden="true">删除</span></a>
			<a class="btn-default" aria-label="Left Align"><span class="glyphicon glyphicon-credit-card" aria-hidden="true">添加说明</span></a>
			<a href="/users/work/gtdModify.html?id=${gtd.id }" class="btn-default" aria-label="Left Align"><span class="glyphicon glyphicon-pencil" aria-hidden="true">修改</span></a>
			
		</div>
      </div>
      <div class="clearfix"></div>
	<jsp:include page="../../../../public/footer2.jsp"/>
</body>
	<script type="text/javascript">
		$(function(){
			
		})
		function start(id){
			var url = "/users/gtdStart.html";
			$.ajax({url:url,data:{id:id},
				dataType:"json",
				success:function(data){
				alert(data.msg);
				window.reload();
			}});
		}
		function finish(id){
			var url = "/users/gtdFinish.html";
			$.ajax({url:url,data:{id:id},
				dataType:"json",
				success:function(data){
				alert(data.msg);
				window.reload();
			}});
		}
		function del(id){
			var url = "/users/gtdDel.html";
			$.ajax({url:url,data:{id:id},
				dataType:"json",
				success:function(data){
				alert(data.msg);
				window.history.back();
			}});
		}
	</script>
</html>